package com.mrjy.queries.bo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import com.mrjy.common.dto.QuestionDto;
import com.mrjy.common.entity.QuestionComment;
import com.mrjy.common.entity.QuestionInfo;
import com.mrjy.common.entity.UserInfo;
import com.mrjy.queries.dto.MiniMyQAQDTO;

import javax.servlet.http.HttpSession;

public interface IQuestionInfoBo {
	
	/**
	 * 前台获取总问题列表----分页查询
	 * @param userInfo
	 * @param questionInfo
	 * @return
	 */
	public List<QuestionInfo> queryQuestionInfosByPage(UserInfo userInfo,QuestionDto questionDto);
	
	/**
	 * 获取当前用户的提问
	 * @param questionDto
	 * @param userInfo
	 * @return
	 */
	public List<QuestionInfo> queryMyQuestionInfos(QuestionDto questionDto ,UserInfo userInfo);
	
	
	
	/**
	 * 后台获取总问题列表----分页查询
	 * @param question
	 * @param userInfo
	 * @return
	 */
	public Map<String, Object> queryQuestionInfosBack(QuestionInfo question,UserInfo userInfo);
	
	//根据ID禁用、起用
	public Object txUpdateDisableFlag(QuestionInfo question,UserInfo userInfo);
	
	/**
	 * 更新置顶状态
	 * @param isStick 
	 * @param questionInfo
	 * @param session
	 * @return
	 */
	public Object txUpdateStickStatus(Integer questionId, String isStick, HttpSession session);
	
	
	//添加
	public String insert(QuestionInfo question,UserInfo userInfo);
	/**
	 * 后台添加
	 * @param questionInfo
	 * @param userInfo
	 * @return
	 */
	public String insertBack(QuestionInfo questionInfo,UserInfo userInfo);
	
	/**
	 * 获取问题阶段
	 * @param userInfo
	 * @return
	 */
	public Object getStageList(UserInfo userInfo);
	
	//根据Id查找
	public QuestionInfo queryQuestionById(int id,UserInfo userInfo);
	
	//根据ID修改
	public Object txUpdateById(QuestionInfo question, HashMap<String, Object> map);
		
	//根据ID删除
	public int deleteByIds(int[] ids);

	public Object getPageQuestionByContent(QuestionInfo question);
	/**
	 * 通过id查询数据
	 * @param id
	 * @return
	 */
    public Object selectById(QuestionInfo questionInfo);

	public Object queryPageNewestQuestion(QuestionInfo info);

    public Object txInsertQuestion(QuestionInfo info, Map<String, Object> map);

    /**
     * 通过userId查询我的问题
	 * @param info
     * @param accessType  访问的类型 （0：问答，1：个人主页,明师主页 2：最新）
     * @return
     */
    Object queryMyQAPageByUserId(QuestionInfo info, HttpSession session);

    public Object queryPageByViewNum(QuestionInfo info);

    /**
	 * 更新问题的浏览量
	 * @param qid
	 * @return
	 */
	public Object txAddQuestionViewNum(Integer qid);

	public Object queryExistQuestionByTopicId(QuestionInfo info,
			HashMap<String, Object> map);
	/**
	 * 后台获取问题列表 
	 * @param info 
	 * @param session 
	 * @return
	 */
	public Object selectQuestionListPage(QuestionInfo info, HttpSession session);
	/**
	 * pc端通过问题话题typeId查询用户的相关信息
	 * @param info
	 * @return
	 */
	public Object queryFamilyQuestionUserInfoForPC(QuestionInfo info);

	public Object queryMyQuestionByUserId(QuestionInfo info);

	public Object selectUserById(int id);

    Object dispatcherQuestion(QuestionInfo info);

    Object queryPageNewestQuestionComment(QuestionInfo info, HttpSession session);

	public Object exportExl(QuestionInfo info, HttpServletResponse response, HttpSession session);

    public Object queryIntelligent(QuestionInfo info);


    Object queryDynamicPageByInfo(QuestionInfo info, QuestionComment comment, HttpSession session);

    Object getPageSearchQuestionByContent(QuestionInfo info, HttpSession session);

    Object queryUserDynamicPageByInfo(QuestionInfo info, QuestionComment comment, HttpSession session);

    Object queryTopicPageByInfo(QuestionInfo info, HttpSession session);

    Object queryTopicIntelligent(QuestionInfo info);

    Object relatedQuestions(QuestionInfo info);

	public Object miniMyQAQ(MiniMyQAQDTO info);

	public Object queryPostPage(QuestionInfo info, HttpSession session);

	public Object latestByTypes(Integer[] types);
}
